package com.coincalf.mapper;

import com.coincalf.entity.ForexOpenPositionOrder;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 开仓订单信息 Mapper 接口
 * </p>
 *
 * @author qiang
 * @since 2018-05-12
 */
public interface ForexOpenPositionOrderMapper extends BaseMapper<ForexOpenPositionOrder> {

    /**
     * 查询待平仓的持仓订单
     *
     * @param marketId 交易对ID
     * @param userId   用户ID
     * @param type     持仓方向
     * @return
     */
    List<ForexOpenPositionOrder> selectToBeCloseList(@Param("marketId") long marketId,
                                                     @Param("userId") long userId,
                                                     @Param("type") int type);
}
